package common

import (
	"math/rand"
	"strings"
)

// GenerateCaptcha -生成4位数字验证码
func GenerateCaptcha() string {
	buf := &strings.Builder{}
	for i := 0; i < 4; i++ {
		buf.WriteByte(byte('0' + rand.Intn(10)))
	}
	return buf.String()
}
